﻿using UnityEngine;
using System.Collections;

public class LobbyPlaneScript : MonoBehaviour {
	
	//public string roomName;
	//public string comments;
	public int stageID;
	public int maxCapacity;
	public int currentCapacity;
	public int roomID;
	
	public TextMesh roomNameTx;
	public TextMesh commentTx;
	public TextMesh capacityTx;
	
	public HostData data;
	LobbyGUIScript parent;
	
	// Use this for initialization
	void Start () {
		parent = transform.parent.GetComponent<LobbyGUIScript>();
	}
	
	// Update is called once per frame
	void Update () {
		
	}
	
	void OnMouseDown()	
	{
		//parent.selectedHost = data;
		parent.selectHost(data,transform);
	}
	
	public void updatePlane(bool Active)
	{
		gameObject.SetActive(Active);
	}
	
	public void updatePlane(HostData _data)
	{
		gameObject.SetActive(true);
		data = _data;
		roomNameTx.text = data.gameName;
		commentTx.text = data.comment;
		capacityTx.text = data.connectedPlayers.ToString() + "/" + data.playerLimit.ToString();;
	}
}
